# Contributor:  Jeff Bilyk <jbilyk@gmail.com>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-sys-hostname-long
_pkgname=Sys-Hostname-Long
pkgver=1.5
pkgrel=6
pkgdesc="Perl Module to get full hostname"
url="https://metacpan.org/dist/Sys-Hostname-Long"
arch="noarch"
license="Artistic-1.0-Perl GPL-1.0-or-later"
depends="perl"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/S/SC/SCOTT/$_pkgname-$pkgver.tar.gz
	hostname-f.patch
	"
options="net"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="
e34a5f17e65eb9c8d3aa213a6d930be4d0b6981dae3bf600e782b0e9863e6584061285a894f9f54daff7520bcadbb3e8cd6b1f9f973ad1c1b72c79e9f588133b  Sys-Hostname-Long-1.5.tar.gz
47ea5f1a35ac286f9f858fb42e8f4b59801cf99d8c61238238095abb8aee6ff706a8763e5d564dd4582bd7d80c3b966632833958cee1b007b71b5ca10b2f0c90  hostname-f.patch
"
